|
Code location |
Code |
Model object |
Details |
|
1 |
/*
|
|
Nonfunctional code (Comment) |
|
2 |
* File: Heading_Mode.c
|
|
Nonfunctional code (Comment) |
|
3 |
*
|
|
Nonfunctional code (Comment) |
|
4 |
* Code generated for Simulink model 'Heading_Mode'.
|
|
Nonfunctional code (Comment) |
|
5 |
*
|
|
Nonfunctional code (Comment) |
|
6 |
* Model version : 1.146
|
|
Nonfunctional code (Comment) |
|
7 |
* Simulink Coder version : 8.5 (R2013b) 08-Aug-2013
|
|
Nonfunctional code (Comment) |
|
8 |
* C/C++ source code generated on : Mon Feb 03 08:13:34 2014
|
|
Nonfunctional code (Comment) |
|
9 |
*
|
|
Nonfunctional code (Comment) |
|
10 |
* Target selection: ert.tlc
|
|
Nonfunctional code (Comment) |
|
11 |
* Embedded hardware selection: 32-bit Embedded Processor
|
|
Nonfunctional code (Comment) |
|
12 |
* Code generation objectives: Unspecified
|
|
Nonfunctional code (Comment) |
|
13 |
* Validation result: Not run
|
|
Nonfunctional code (Comment) |
|
14 |
*/
|
|
Nonfunctional code (Comment) |
|
15 |
|
|
Nonfunctional code (Empty line) |
|
16 |
#include "Heading_Mode.h"
|
|
Not processed (Include statement) |
|
17 |
#include "Heading_Mode_private.h"
|
|
Not processed (Include statement) |
|
18 |
|
|
Nonfunctional code (Empty line) |
|
19 |
/* Output and update for referenced model: 'Heading_Mode' */
|
|
Nonfunctional code (Comment) |
|
20 |
void Heading_Mode(const real_T *rtu_PsiRef, const real_T *rtu_Psi, const real_T ... |
|
- |
|
21 |
rtu_TAS, real_T *rty_PhiCmd, rtB_Heading_Mode *localB, real_T
... |
|
- |
|
22 |
rtp_hdgGain)
|
|
- |
|
23 |
{
|
|
Nonfunctional code (Start of code segment) |
|
24 |
real_T rtb_sum;
|
|
Local variable declaration |
|
25 |
real_T y;
|
|
Local variable declaration |
|
26 |
|
|
Nonfunctional code (Empty line) |
|
27 |
/* Sum: '<S1>/sum' */
|
|
Nonfunctional code (Comment) |
|
28 |
rtb_sum = (*rtu_PsiRef) - (*rtu_Psi);
|
|
- |
|
29 |
|
|
Nonfunctional code (Empty line) |
|
30 |
/* Signum: '<S1>/signum' */
|
|
Nonfunctional code (Comment) |
|
31 |
if (rtb_sum < 0.0) {
|
|
- |
|
32 |
y = -1.0;
|
|
- |
|
33 |
} else if (rtb_sum > 0.0) {
|
|
- |
|
34 |
y = 1.0;
|
|
- |
|
35 |
} else {
|
|
- |
|
36 |
y = rtb_sum;
|
|
- |
|
37 |
}
|
|
Nonfunctional code (End of code segment) |
|
38 |
|
|
Nonfunctional code (Empty line) |
|
39 |
/* Sum: '<S1>/sum1' incorporates:
|
|
Nonfunctional code (Comment) |
|
40 |
* Abs: '<S1>/abs'
|
|
Nonfunctional code (Comment) |
|
41 |
* Constant: '<S1>/constant'
|
|
Nonfunctional code (Comment) |
|
42 |
* Constant: '<S1>/constant1'
|
|
Nonfunctional code (Comment) |
|
43 |
* Product: '<S1>/product'
|
|
Nonfunctional code (Comment) |
|
44 |
* Product: '<S1>/product1'
|
|
Nonfunctional code (Comment) |
|
45 |
* Product: '<S1>/product2'
|
|
Nonfunctional code (Comment) |
|
46 |
* Rounding: '<S1>/floor'
|
|
Nonfunctional code (Comment) |
|
47 |
* Signum: '<S1>/signum'
|
|
Nonfunctional code (Comment) |
|
48 |
* Sum: '<S1>/sum2'
|
|
Nonfunctional code (Comment) |
|
49 |
*/
|
|
Nonfunctional code (Comment) |
|
50 |
localB->hdgError = rtb_sum - (y * (floor((fabs(rtb_sum) + 180.0) / 360.0) *
|
|
- |
|
51 |
360.0));
|
|
- |
|
52 |
|
|
Nonfunctional code (Empty line) |
|
53 |
/* Product: '<Root>/Product' incorporates:
|
|
Nonfunctional code (Comment) |
|
54 |
* Gain: '<Root>/Disp Gain'
|
|
Nonfunctional code (Comment) |
|
55 |
*
|
|
Nonfunctional code (Comment) |
|
56 |
* Block requirements for '<Root>/Product':
|
|
Nonfunctional code (Comment) |
|
57 |
* 1. 1.10. Heading Performance
|
|
Nonfunctional code (Comment) |
|
58 |
*
|
|
Nonfunctional code (Comment) |
|
59 |
* Block requirements for '<Root>/Disp Gain':
|
|
Nonfunctional code (Comment) |
|
60 |
* 1. 1.10. Heading Performance
|
|
Nonfunctional code (Comment) |
|
61 |
*/
|
|
Nonfunctional code (Comment) |
|
62 |
*rty_PhiCmd = (rtp_hdgGain * localB->hdgError) * (*rtu_TAS);
|
|
- |
|
63 |
}
|
|
Nonfunctional code (End of code segment) |
|
64 |
|
|
Nonfunctional code (Empty line) |
|
65 |
/* Model initialize function */
|
|
Nonfunctional code (Comment) |
|
66 |
void Heading_Mode_initialize(rtB_Heading_Mode *localB)
|
|
- |
|
67 |
{
|
|
Nonfunctional code (Start of code segment) |
|
68 |
/* Registration code */
|
|
Nonfunctional code (Comment) |
|
69 |
|
|
Nonfunctional code (Empty line) |
|
70 |
/* block I/O */
|
|
Nonfunctional code (Comment) |
|
71 |
(void) memset(((void *) localB), 0,
|
|
- |
|
72 |
sizeof(rtB_Heading_Mode));
|
|
- |
|
73 |
}
|
|
Nonfunctional code (End of code segment) |
|
74 |
|
|
Nonfunctional code (Empty line) |
|
75 |
/*
|
|
Nonfunctional code (Comment) |
|
76 |
* File trailer for generated code.
|
|
Nonfunctional code (Comment) |
|
77 |
*
|
|
Nonfunctional code (Comment) |
|
78 |
* [EOF]
|
|
Nonfunctional code (Comment) |
|
79 |
*/
|
|
Nonfunctional code (Comment) |